package com.example.dell.fastshopping.user.entity;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created by ${YSH} on 2019/5/15.
 * 描述        ${TODO}
 * <p>
 * 更新者       $author$
 * 更新时间     $Data$
 * 描述         ${TODO}
 */
public class UserInfo {
    private int id; //:1057,
    private String userName; //: ; //7284R4 ; //,
    private String icon; //:null,
    private String openid; //:null,
    private String area; //:null,
    private String address; //:null,
    private int status; //:0,
    private int openno; //:0,
    private String phone; //: ; //13554427167 ; //,
    private BigDecimal balance; //:0,余额
    private int integral; //:0, 积分
    private long createTime; //:20190511143129,
    private long updateTime; //:1557815837021,
    private int sex; //:null,
    private BigDecimal amount; //:0,
    private String token; //:"43e55784f91d44569952430f55ab0a521557815837024",
    private List<Amounts> list;

    public void setList(List<Amounts> list) {
        this.list = list;
    }

    public List<Amounts> getList() {
        return list;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public void setOpenno(int openno) {
        this.openno = openno;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public void setUpdateTime(long updateTime) {
        this.updateTime = updateTime;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public int getId() {
        return id;
    }

    public String getUserName() {
        return userName;
    }

    public String getIcon() {
        return icon;
    }

    public String getOpenid() {
        return openid;
    }

    public String getArea() {
        return area;
    }

    public String getAddress() {
        return address;
    }

    public int getStatus() {
        return status;
    }

    public int getOpenno() {
        return openno;
    }

    public String getPhone() {
        return phone == null ? "" : phone;
    }

    public long getCreateTime() {
        return createTime;
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public String getSex() {
        return sex == 0 ? "女" : "男";
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public String getToken() {
        return token;
    }


    public void setIntegral(int integral) {
        this.integral = integral;
    }

    public void setCreateTime(int createTime) {
        this.createTime = createTime;
    }

    public void setUpdateTime(int updateTime) {
        this.updateTime = updateTime;
    }


    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public String getBalance() {
        if (balance == null) {
            return "0.00";
        } else {
            return balance.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
        }

    }

    public int getIntegral() {
        return integral;
    }

    public String getBalanceString() {
        if (balance == null) {
            return "0.00";
        }
        return balance.setScale(2, BigDecimal.ROUND_HALF_DOWN).toString();
    }

    public String getIntegralString() {
        if (amount == null) {
            return "";
        } else {
            return amount.setScale(2, BigDecimal.ROUND_HALF_DOWN).toString();
        }
    }


    //竞拍档场次
    public class Amounts {

        private int id;// 1,
        private String gradeName;// 体验场
        private BigDecimal amount;// null,  我已缴纳的保证金额
        private int mid;// null
        private String val;

        public void setVal(String val) {
            this.val = val;
        }

        public String getVal() {
            return val;
        }

        public void setId(int id) {
            this.id = id;
        }

        public void setAmount(BigDecimal amount) {
            this.amount = amount;
        }

        public void setMid(int mid) {
            this.mid = mid;
        }

        public int getId() {
            return id;
        }

        public void setGradeName(String gradeName) {
            this.gradeName = gradeName;
        }

        public String getGradeName() {
            return gradeName;
        }

        public BigDecimal getAmount() {
            return amount;
        }

        public int getMid() {
            return mid;
        }

        public String getAmountString() {
            if (amount == null) {
                return "0.00";
            } else {
                return amount.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
            }
        }
    }

}
